<template>
  <div>
    <div>
      <el-form v-if="!isSuccess" ref="form" :model="form" label-width="80px">
        <el-form-item
          label="商品总价"
        >
          <span
            style="
          font-size:20px"
          >
            {{ totalprice }}元
          </span>
        </el-form-item>
        <el-form-item label="收货地址">
          <el-select v-model="form.address" placeholder="请选择默认地址">
            <el-option label="学校" value="shanghai" />
            <el-option label="家里" value="beijing" />
          </el-select>
          <el-button type="primary">添加地址</el-button>
        </el-form-item>
        <el-form-item label="支付方式">
          <el-checkbox-group v-model="form.type">
            <el-checkbox label="支付宝" name="type" />
            <el-checkbox label="微信" name="type" />
            <el-checkbox label="银行卡" name="type" />
          </el-checkbox-group>
        </el-form-item>
        <el-form-item label="商品列表">
          <el-card class="box-card" style="margin: 0 auto">
            <div v-for="item in storelist" v-show="item.isChoose" :key="item.id" class="text item">
              {{ item.name }} * {{ item.count }} = {{ item.price*item.count }}
            </div>
          </el-card>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="isSuccess = true">提交</el-button>
        </el-form-item>
      </el-form>
    </div>

    <div v-if="isSuccess" style="margin:200px">
      <h1>支付成功</h1>
      <el-button type="success" icon="el-icon-check" circle />
    </div>
  </div>
</template>

<script>
export default {
  props: ['storelist', 'totalprice'],
  data() {
    return {
      isSuccess: false,
      form: {
        totalPrice: 0,
        address: '',
        pay: '',

        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      }
    }
  },
  methods: {
    submit() {

    }
  }
}
</script>

<style>
@import "../../assets/css/origincss2/青竹0.css";
@import "../../assets/css/origincss2/青竹6.css";
@import "../../assets/css/iconfont/iconfont.css";
@import "../../assets/css/origincss2/购物车.css";

  .text {
    font-size: 14px;
  }

  .item {
    padding: 8px 0;
  }

  .box-card {
    width: 500px;
  }
</style>
